package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class Salle implements Serializable {

	private static final long serialVersionUID = -7387107731762695420L;

	private int numSalle;
	private int capacite;
	private String lieu;
	private Collection<Reunion> listeReunions;
	private Collection<Creneau> listeCreneaux;

	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Salle() {}
	
	public Salle(int numSalle, int capacite, String lieu) {
		super();
		this.numSalle = numSalle;
		this.capacite = capacite;
		this.lieu = lieu;
		this.listeCreneaux = null;
		this.listeReunions = null;
	}

	public Collection<Creneau> getListeCreneau() {
		return listeCreneaux;
	}

	public void setListeCreneau(Collection<Creneau> listeCreneau) {
		this.listeCreneaux = listeCreneau;
	}
	
	public Collection<Reunion> getListeReunions() {
		return listeReunions;
	}

	public void setListeReunions(Collection<Reunion> listeReunions) {
		this.listeReunions = listeReunions;
	}

	public int getNumSalle() {
		return numSalle;
	}
	
	public void setNumSalle(int numSalle) {
		this.numSalle = numSalle;
	}
	
	public int getCapacite() {
		return capacite;
	}
	
	public void setCapacite(int capacite) {
		this.capacite = capacite;
	}
	
	public String getLieu() {
		return lieu;
	}
	
	public void setLieu(String lieu) {
		this.lieu = lieu;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
